<template>
  <div class="app matrix-bg min-h-screen">
    <div class="flex">
      <!-- 侧边栏 -->
      <aside class="w-64 bg-dark-darker h-screen fixed left-0 top-0 shadow-lg">
        <div class="p-6">
          <div class="flex items-center mb-8">
            <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center mr-3 animate-pulse-slow">
              <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path>
              </svg>
            </div>
            <h1 class="text-xl font-bold glow-text">KubeRelayer</h1>
          </div>

          <nav class="space-y-1">
            <router-link to="/" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path === '/' }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path>
              </svg>
              仪表盘
            </router-link>

            <router-link to="/services" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path === '/services' }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path>
              </svg>
              服务管理
            </router-link>

            <router-link to="/record" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path.startsWith('/record') }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"></path>
              </svg>
              记录管理
            </router-link>

            <router-link to="/request" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path.startsWith('/request') }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"></path>
              </svg>
              请求管理
            </router-link>

            <router-link to="/intercept" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path.startsWith('/intercept') }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path>
              </svg>
              拦截管理
            </router-link>

            <router-link to="/traces" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path.startsWith('/traces') }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"></path>
              </svg>
              链路追踪
            </router-link>

            <router-link to="/faults" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path === '/faults' }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
              </svg>
              故障注入
            </router-link>

            <router-link to="/settings" class="nav-link flex items-center p-3 rounded-md hover:bg-dark-light" :class="{ 'bg-dark-light nav-link-active': $route.path === '/settings' }">
              <svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
              </svg>
              系统设置
            </router-link>
          </nav>
        </div>

        <div class="absolute bottom-0 left-0 right-0 p-6">
          <div class="text-sm text-light-dark text-center">
            <div>KubeRelayer v1.0.0</div>
            <div class="mt-1">© 2025 KubeRelayer</div>
          </div>
        </div>
      </aside>

      <!-- 主内容区 -->
      <main class="flex-1 ml-64 p-8">
        <router-view />
      </main>
    </div>
  </div>
</template>

<script setup lang="ts">
// 组件逻辑
</script>

<style>
/* 全局样式已在 style.css 中定义 */
</style>
